ifneq ($(NOT_SUPPORT_SP), y)
    EXTRA_CFLAGS += -fstack-protector-all
endif

ccflags-y += -Wall -Werror

ifeq ($(TOP_DIR),)
    ifeq ($(DAVINCI_HIAI_DKMS),y)
        EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc/inc
        EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/inc/driver
        EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/svmdrv/common
        EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/libc_sec/include
    else
        ccflags-y += -Wtrampolines $(WDATE_TIME) -Wfloat-equal -Wvla -Wundef -funsigned-char -Wformat=2 -Wstack-usage=2048 -Wcast-align -Wextra
        ccflags-y += -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-nonliteral
        KERNEL_DIR := $(srctree)
        EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../dev_inc/inc
        EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../inc/driver
        EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../src/svmdrv/common/
        EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../abl/libc_sec/include
    endif
    EXTRA_CFLAGS += -DCFG_FEATURE_SHARE_LOG

    drv_svm_peermem-objs := svm_peer_mem.o
    obj-m := drv_svm_peermem.o
else
    ifeq ($(DAVINCI_HIAI_DKMS),y)
        EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc/inc
        EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/inc/driver
        EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/svmdrv/common
        EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/libc_sec/include
    else
        ccflags-y += -Wtrampolines $(WDATE_TIME) -Wfloat-equal -Wvla -Wundef -funsigned-char -Wformat=2 -Wstack-usage=2048 -Wcast-align -Wextra
        ccflags-y += -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-nonliteral
        EXTRA_CFLAGS += -I$(TOP_DIR)/inc/driver
        EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/inc
        EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/svmdrv/common/
        EXTRA_CFLAGS += -I$(TOP_DIR)/abl/libc_sec/include
    endif
    EXTRA_CFLAGS += -DCFG_FEATURE_SHARE_LOG

    drv_svm_peermem-objs := svm_peer_mem.o
    obj-m := drv_svm_peermem.o
endif
